package cn.wyl.controller;


import cn.wyl.User;
import cn.wyl.feignclient.UserFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 */
@RestController
public class OrderController {
    //需要配置成Bean
    @Autowired
    private UserFeignClient userFeignClient;


    //浏览器调用该方法
    @RequestMapping("/order/{id}")
    public User getById(@PathVariable("id")Long id){
        //使用Feign调用用户服务获取User
        return userFeignClient.getById(id);

    }


}
